package com.suptrack.web.rest;

import java.util.List;

import javax.ejb.EJB;
import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.suptrack.entity.Position;
import com.suptrack.service.CarService;
import com.suptrack.service.PositionService;
import com.suptrack.service.ZoneService;

@Path("/position")
public class PositionResource {
	
	@EJB
	CarService carservice;
	@EJB
	PositionService posservice;
	
	
	@GET @Produces(MediaType.APPLICATION_XML) @Path("/{id}")
	public List<Position> getPosByCarIdXml(@PathParam("id")long id ) {
	List<Position> carlistpos = carservice.getCarInfoService(id).getPosition();
	
		return carlistpos;
	}	
	
	@POST  @Consumes(MediaType.APPLICATION_XML)
	public void addPosition(Position _pos) {
		posservice.addPositionService(_pos);
			 
	}
}
